<template>
    <h3 style="text-align:center;">用户投资明细</h3>
    <table class="table table-border">
        <thead>
            <tr style="background-color: aqua;">
                <td>投资人登录账号</td>
                <td>投资金额</td>
                <td>投资时间</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="item in data" :key="item.I_Id">
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.UI_Money }}</td>
                <td>{{ item.UI_Time }}</td>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
import { useRoute } from 'vue-router'
import axios from 'axios'
import { ref, onMounted } from 'vue'

//获取路由函数实例
const route = useRoute()
const Iid = route.params.Iid;

const data = ref([{
    UL_Name: "",
    UI_Time: "",
    UI_Money: "",
    I_Id: ""
}])

onMounted(() => {
    axios({
        method: "get",
        url: "https://localhost:44305/api/Invests/SearchUserInvestInfo",
        params: {
            Iid: Iid
        }
    })
        .then(function (res) {
            data.value = res.data;
        })
})

</script>